package com.sx.zongzhi.modle;

import com.sx.zongzhi.bean.BuildingBean;
import com.sx.zongzhi.bean.BuildingListBean;
import com.sx.zongzhi.bean.BusinessBean;
import com.sx.zongzhi.bean.CheckFixedBean;
import com.sx.zongzhi.bean.HouseBean;
import com.sx.zongzhi.bean.OverseasBean;
import com.sx.zongzhi.bean.OverseasDetailBean;
import com.sx.zongzhi.bean.PopulationBean;
import com.sx.zongzhi.bean.PopulationDetailBean;
import com.sx.zongzhi.bean.PopulationFixedBean;
import com.sx.zongzhi.bean.PopulationFixedDetailBean;
import com.sx.zongzhi.bean.PopulationMoveBean;
import com.sx.zongzhi.bean.PopulationMoveDetailBean;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BasePageListBean;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.net.ServiceFactory;

import java.util.List;
import java.util.Map;

import retrofit2.Call;


/**
 * Created by XZY on 2017/11/30.
 *  api 代码管理层
 */
public class CollectManager {

    /**
     *  获取户籍人员列表
     */
    public void getPopHouseholdList(Map<String,Object> map, BaseCallBack<BaseResult<PopulationBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<PopulationBean>> resultCall = service.getPopHouseholdList(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取户籍人员详情
     */
    public void getPopHouseholdDetail(Map<String,Object> map, BaseCallBack<BaseResult<PopulationDetailBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<PopulationDetailBean>> resultCall = service.getPopHouseholdDetail(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取户籍人员业务信息
     */
    public void getBusinessList(Map<String,Object> map, BaseCallBack<BaseResult<List<BusinessBean>>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<List<BusinessBean>>> resultCall = service.getBusinessList(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  删除户籍人员
     */
    public void deletePopHousehold(Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.deletePopHousehold(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  户籍人口验证身份证/户号

     */
    public void checkHouseHold(String path,Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.checkHouseHold(path,map);
        resultCall.enqueue(callBack);
    }

    /**
     * 户籍人口新增/修改
     */
    public void addHouseHold(String path,Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addHouseHold(path,map);
        resultCall.enqueue(callBack);
    }


    /**
     *  获取流动人员列表
     */
    public void getPopMoveList(Map<String,Object> map, BaseCallBack<BaseResult<PopulationMoveBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<PopulationMoveBean>> resultCall = service.getPopMoveList(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取流动人员详情
     */
    public void getPopMoveDetail(Map<String,Object> map, BaseCallBack<BaseResult<PopulationMoveDetailBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<PopulationMoveDetailBean>> resultCall = service.getPopMoveDetail(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  删除流动人员
     */
    public void deletePopMove(Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.deletePopMove(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  流动人员验证身份证
     */
    public void checkPopMove(Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.checkPopMove(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 流动人员新增/修改
     */
    public void addPopMove(String path,Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addPopMove(path,map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取海外人员列表
     */
    public void getOverseasList(String path,Map<String,Object> map, BaseCallBack<BaseResult<OverseasBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<OverseasBean>> resultCall = service.getOverseasList(path,map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取海外人员详情
     */
    public void getOverseasDetail(Map<String,Object> map, BaseCallBack<BaseResult<OverseasDetailBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<OverseasDetailBean>> resultCall = service.getOverseasDetail(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  删除海外人员
     */
    public void deleteOverseas(Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.deleteOverseas(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  海外人员验证身份证
     */
    public void checkOverseas(Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.checkOverseas(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 新增/修改境外人口
     */
    public void addOverseas(String path,Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addOverseas(path,map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取留守人员列表
     */
    public void getPopFixedList(String path,Map<String,Object> map, BaseCallBack<BaseResult<PopulationFixedBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<PopulationFixedBean>> resultCall = service.getPopFixedList(path,map);
        resultCall.enqueue(callBack);
    }

    /**
     *  获取留守人员详情
     */
    public void getPopFixedDetail(Map<String,Object> map, BaseCallBack<BaseResult<PopulationFixedDetailBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<PopulationFixedDetailBean>> resultCall = service.getPopFixedDetail(map);
        resultCall.enqueue(callBack);
    }

    /**
     *  删除留守人员
     */
    public void deleteFixed(Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.deleteFixed(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 新增/修改留守人员
     */
    public void addFixed(String path,Map<String,Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addFixed(path,map);
        resultCall.enqueue(callBack);
    }

    /**
     * 检测是否存在相同号码的留守人员
     */
    public void checkFixed(Map<String,Object> map, BaseCallBack<BaseResult<CheckFixedBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<CheckFixedBean>> resultCall = service.checkFixed(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 实有房屋列表
     */
    public void getFactHouseList(Map<String, Object> map, BaseCallBack<BaseResult<BasePageListBean<HouseBean>>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<BasePageListBean<HouseBean>>> resultCall = service.getFactHouseList(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 实有房屋/出租房详情
     */
    public void getFactHouseDetail(Map<String, Object> map, BaseCallBack<BaseResult<HouseBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<HouseBean>> resultCall = service.getFactHouseDetail(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 实有房屋/出租房详情(添加)
     */
    public void addFactHouse(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addFactHouse(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 实有房屋/出租房详情(删除)
     */
    public void deleteFactHouse(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.deleteFactHouse(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 实有房屋/出租房详情(修改)
     */
    public void updateFactHouse(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.updateFactHouse(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 获取楼宇列表
     */
    public void loadBuildingList(Map<String, Object> map, BaseCallBack<BaseResult<BuildingListBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<BuildingListBean>> resultCall = service.loadBuildingList(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 楼宇新增/修改
     */
    public void addBuilding(String path,Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addBuilding(path,map);
        resultCall.enqueue(callBack);
    }
    /**
     * 楼宇删除
     */
    public void deleteBuilding(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.deleteBuilding(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 添加楼宇布局
     */
    public void addBuildingLayout(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.addBuildingLayout(map);
        resultCall.enqueue(callBack);
    }

    /**
     * 获取布局列表
     */
    public void loadBuildLayoutList(Map<String, Object> map, BaseCallBack<BaseResult<BuildingBean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<BuildingBean>> resultCall = service.loadBuildLayoutList(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 绑定楼宇
     */
    public void bindBuilding(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.bindBuilding(map);
        resultCall.enqueue(callBack);
    }
    /**
     * 解绑楼宇
     */
    public void unbindBuilding(Map<String, Object> map, BaseCallBack<BaseResult<Boolean>> callBack) {
        CollectService service = ServiceFactory.getInstance().createNewService(CollectService.class);
        Call<BaseResult<Boolean>> resultCall = service.unbindBuilding(map);
        resultCall.enqueue(callBack);
    }

}
